<?php /*a:3:{s:54:"D:\phpstudy_pro\WWW\tp\app\admin\view\login\index.html";i:1640261441;s:54:"D:\phpstudy_pro\WWW\tp\app\admin\view\common\meta.html";i:1655800829;s:56:"D:\phpstudy_pro\WWW\tp\app\admin\view\common\footer.html";i:1640261441;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<script src="/static/layui/layui.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="/static/layui/js-3.1.1.min.js"></script>
    <title>VeeCMF 通用后台管理系统 - 快速接口开发 快速后台开发</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="layui-row">
            <div class="layui-col-xs12">
                <div class="grid-demo grid-demo-bg1">

                    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                        <legend>VeeCMF 通用后台管理系统欢迎您！</legend>
                    </fieldset>

                    <div class="layui-bg-gray" style="padding: 30px;">
                        <div class="layui-row layui-col-space15">
                            <div class="layui-col-md8">
                                <div class="layui-card">
                                    <div class="layui-card-header">广告大屏</div>
                                    <div class="layui-card-body">
                                        <img width="49%" src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2Ftp05%2F19100122420C335-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642227829&t=5d6da548d3ee8547f3fc84ba2aa3dc93">
                                        <img width="49%" src="https://img2.baidu.com/it/u=2229864841,4232235061&fm=26&fmt=auto">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-md4">
                                <div class="layui-card">
                                    <div class="layui-card-header">管理员登陆</div>
                                    <div class="layui-card-body">
                                        <div class="layui-form layui-form-pane">
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">用户名</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="root_username" lay-verify="root_username" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                                                </div>
                                                <div class="layui-form-mid layui-word-aux">请务必填写用户名</div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">密码</label>
                                                <div class="layui-input-inline">
                                                    <input type="password" name="root_password" lay-verify="root_password" placeholder="请输入密码" autocomplete="off" class="layui-input">
                                                </div>
                                                <div class="layui-form-mid layui-word-aux"><?php echo htmlentities($errorMsg); ?></div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">验证码</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="verifyCode" lay-verify="verifyCode" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                                                </div>
                                                <div class="layui-form-mid layui-word-aux"><img width="100%" onclick="this.src=this.src+'&k='+Math.random();" src="/admin/captcha"></div>
                                            </div>
                                            <div class="layui-form-item">
                                                <button class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="goLogin">登录</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <!--<div class="layui-footer">-->
<!--    &lt;!&ndash; 底部固定区域 &ndash;&gt;-->
<!--    底部固定区域-->
<!--</div>-->

<script>
    //JS
    layui.use(['element', 'layer', 'util'], function(){
        var element = layui.element
            ,layer = layui.layer
            ,util = layui.util
            ,$ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
            ,menuRight: function(){

                layer.open({
                    type: 1
                    ,content: '<div id="msgList"></div>'
                    ,area: ['260px', '100%']
                    ,offset: 'rt' //右上角
                    ,anim: 5
                    ,shadeClose: true
                });
                var html = '';
                $.ajax({
                    url: "http://1.117.149.125:81/api/msgList",
                    type: "GET",
                    data:{
                        'data':'',
                    },
                    dataType: "json",
                    success: function(data){
                        data['data'].forEach(function(item) {
                            console.log(item);
                            html += '<div style="padding: 15px;">'+item['content']+'</div>';
                        });
                        $('#msgList').html(html);
                    },
                    error:function(err){
                        console.log(err.statusText);
                    }
                });
            }
        });

    });
</script>
</div>
<script>
    layui.use(['form'], function(){
        var form = layui.form
            ,layer = layui.layer

        //自定义验证规则
        form.verify({
            root_username: function(value){
                if(value.length < 1){
                    return '请输入用户名';
                }
            }
            ,root_password: function(value){
                if(value.length < 1){
                    return '请输入密码';
                }
            }
            ,verifyCode: function(value){
                if(value.length < 1){
                    return '请输入验证码';
                }
            }
        });


        //监听提交
        form.on('submit(goLogin)', function(data){
            $.ajax({
                url: "/admin/login/CheckRoot",
                type: "POST",
                data:{
                    'loginData':data.field,
                },
                dataType: "json",
                success: function(result){
                    console.log(result)
                    if(result.code === 0){
                        //登陆成功
                        layer.msg(result.msg);
                        window.location = '/admin/index/index';
                    }else{
                        //登陆失败
                        layer.msg(result.msg);
                        return false;
                    }
                },
                error:function(err){
                    console.log(err.statusText);
                }
            });
        });


    });
</script>
</body>
</html>